package com.littleken.order.model;

import com.littleken.order.enums.OrderStatusEnum;
import com.littleken.order.enums.PayStatusEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.Id;
import java.math.BigDecimal;
import java.util.Date;

@Entity
@DynamicUpdate

@Data // @Data = @Getter + @Setter + @ToString
@AllArgsConstructor
@NoArgsConstructor
/**
 * 订单实体类
 */
public class OrderMaster {

    @Id
    private String orderId;

    private String buyerName;

    private String buyerPhone;

    private String buyerAddress;
    //买家微信openid
    private String buyerOpenid;
    //订单总金额
    private BigDecimal orderAmount;
    //订单状态,默认为新订单0     1完结，2取消
    private Integer orderStatus = OrderStatusEnum.NEW.getCode();
    //支付状态,默认为未支付0    1完成支付
    private Integer payStatus = PayStatusEnum.WAIT.getCode();

    private Date createTime;

    private Date updateTime;

}